<?php

namespace app\modules\system\controllers;

use Yii;
use app\controllers\InternalBaseController;
use app\modules\system\actions as actions;

class ManagerController extends InternalBaseController {
    
    public function init(){
        
    }
    
    //管理员登录
    public function actionLogin() {
        $post= Yii::$app->request->get();
        if(empty($post)) {
            $post= Yii::$app->request->post();
        }
        $action = new actions\Manager();
        $ret = $action->UserLogin($post);
        return $ret;
    }
    
    // 添加管理员
    public function actionAddmanager() {
        $post= Yii::$app->request->get();
        if(empty($post)) {
            $post= Yii::$app->request->post();
        }
        $action = new actions\Manager();
        $ret = $action->AddManager($post);
        return $ret;
    }
    
    //删除管理员
    public function actionDelmanager() {
        $post= Yii::$app->request->get();
        if(empty($post)) {
            $post= Yii::$app->request->post();
        }
        $action = new actions\Manager();
        $ret = $action->DelManager($post);
        return $ret;
    }
    
    //修改管理员密码
    public function actionModifymanager() {
        $post= Yii::$app->request->get();
        if(empty($post)) {
            $post= Yii::$app->request->post();
        }
        $action = new actions\Manager();
        $ret = $action->ModifyManager($post);
        return $ret;
    }
    
    //禁用 管理员
    public function actionClosemanager() {
        $post= Yii::$app->request->get();
        if(empty($post)) {
            $post= Yii::$app->request->post();
        }
        $action = new actions\Manager();
        $ret = $action->CloseManager($post);
        return $ret;
    }
    
    //开启 管理员
    public function actionOpenmanager() {
        $post= Yii::$app->request->get();
        if(empty($post)) {
            $post= Yii::$app->request->post();
        }
        $action = new actions\Manager();
        $ret = $action->OpenManager($post);
        return $ret;
    }
    
    //管理员列表
    public function actionManagerlist() {
        $post= Yii::$app->request->get();
        if(empty($post)) {
            $post= Yii::$app->request->post();
        }
        $action = new actions\Manager();
        $ret = $action->ManagerList($post);
        return $ret;
    }
}